import { createStore, combineReducers, applyMiddleware, compose } from 'redux'

import reducers from './reducers'
import thunk from 'redux-thunk'

export default createStore(
    combineReducers(reducers),
    // store 默认值
    {
        shouldLoad: true, // 客户端是否加载数据
        oneLevelPartitions: [], // 一级分类
        banners: [], // 轮播图

        partitions: [], // 分类列表
        rankingPartitions: [], // 排行榜分类列表
        rankingVideos: [], // 排行榜视频
        tabindex: 0,
        isdraw: false,
        additionalVideos: [], // 首页额外的video
        video: {}, // 视频信息
        upUser: {}, // up主信息,
        liveData: {
            // 直播数据
            bannerList: [],
            itemList: []
        },
        liveListData: {
            // 直播房间列表
            total: 0,
            list: []
        },
        roomData: {} // 直播间数据
    },
    compose(
        applyMiddleware(thunk),
        window.devToolsExtension ? window.devToolsExtension() : (f) => f
    )
)
